<?php

include_once('_path.php');

include_once(_CONST_LOCAL_INCLUDE_PATH."database.class.php");
$database = new Database($db_vars);

include_once(_CONST_LOCAL_INCLUDE_PATH."common.php");

$page = intval($_GET['page']);
if($page>0 && ($page%5!=1)){
#查找page
	$rs = $database->queryArray("SELECT v.*, u.name, ui.avatar " 
							   ."FROM vote v "
							   ."LEFT JOIN user u ON u.id = v.user_id "
							   ."LEFT JOIN user_info ui ON ui.user_id = v.user_id "
							   ."ORDER BY create_time DESC "
							   ."LIMIT ".(($page - 1) * 10).", 10");
	if(sizeof($rs)>0){
	foreach($rs as $h){
	?>
	<div class="pin">
		<a href="<?php echo _CONST_WEB_URL . 'vote.php?id=' . $h['id']?>"><img src="<?php echo _CONST_PIC_URL . 'vote/' . $h['user_id'] . '/1_' .$h['images']?>" /></a>
		<div class="votings-info">
			<div class="votings-user"><span class="name"><?php echo $h['name']?></span><img src="<?php echo iif(!empty($h['avatar']), _CONST_PIC_URL . 'avatar/' . $h['user_id'] . '/' . $h['avatar'], _CONST_IMG_URL . 'avatar/1.jpg')?>" alt="<?php echo $h['name']?>" /></div>
			<div class="votings-data"><span class="votings-down"><?php echo $h['sub']?></span><span class="votings-up"><?php echo $h['add']?></span></div>
		</div>
	</div>
	<?php 
	}
  }
}
exit;
?>
